﻿using Coldairarrow.Entity.Frontstage.Valickets;
using Coldairarrow.Util;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Threading.Tasks;

namespace Coldairarrow.Business.Frontstage.Valickets
{
    public interface IBS_UserPUseLogBusiness
    {
        Task<PageResult<BS_UserPUseLog>> GetDataListAsync(PageInput<ConditionDTO> input);
        Task UserGetPoint(GetPointDto input);
        Task<PageResult<GetUPLogDTO>> GetPDataListAsync(PageInput<ConditionDTO> input);
        PointSum GetUSumData();
        Task<BS_UserPUseLog> GetTheDataAsync(string id);
        Task AddDataAsync(BS_UserPUseLog data);
        Task UpdateDataAsync(BS_UserPUseLog data);
        Task DeleteDataAsync(List<string> ids);
    }

    public class PointSum
    {

        /// <summary>
        /// 未使用积分数量
        /// </summary>
        public int NUPointNum { set; get; }

        ///<summary>
        ///已获得积分数量
        /// </summary>
        public int SumPointNum { set; get; }

        /// <summary>
        /// 已使用积分数量
        /// </summary>
        public int UsePointNum { set; get; }
    }
    public class GetPointDto
    { 
        /// <summary>
        /// 来源
        /// </summary>
       [Required]
       public string Note { set; get; }

        /// <summary>
        /// 积分数量
        /// </summary>
        [Required]
        public int Point { set; get; } = 1;

        /// <summary>
        /// 录入代码
        /// </summary>
        [Required]
        public string Code { set; get; }
    }
    public class GetUPLogDTO { 
        public string Id { get; set; }

        /// <summary>
        /// 积分数量（获得/使用）
        /// </summary>
        public Int32? PointNum { get; set; }

        /// <summary>
        /// 类型（0.获得,1.使用）
        /// </summary>
        public Int32? Type { get; set; }

        /// <summary>
        /// 来源/用途
        /// </summary>
        public String Purpose { get; set; }

        /// <summary>
        /// 获取(使用)时间
        /// </summary>
        public DateTime? Time { get; set; }

    }
}